package cn.com.infcn.beanCondition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

//实现了Condition接口的类，作用就是判断是否满足条件
public class IsCreateTransportClient implements Condition{

	@Override
	public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadate) {
		 Environment evn = context.getEnvironment();
		 boolean property = Boolean.parseBoolean(evn.getProperty("is_msp"));
	        return property;
	}
}